<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局(2)</title>

    <style>
        *{
            margin: 0;
            padding: 0;
        }
        /* #div0{
            width: 400px;
            height: 400px;
        }
       @media screen and (max-width:399px) and (max-height:400px) {
           #div0{
               background-color: #ccc;
           }
       }
       
       @media screen and (min-width:400px) and (max-width:800px) {
           #div0{
               background-color: red;
           }
       }

       @media screen and (min-width:801px)  {
           #div0{
               background-color: blue;
           }
       } */
    </style>
</head>
<body>
    <div id="div0">
        <h1>请缩放浏览器查看效果</h1>
        <picture>
            <source srcset="./img/image1.jpg" media="(max-width:800px)">
            <img src="./img/image2.jpg" style="width: 50%" alt=""/>
            
        </picture>
    </div>
</body>
</html>